#coding=utf-8

from socket import *

host = '192.168.11.169'
port = 12345
BUF_SIZE = 1024
addr = (host,port)

client_sock = socket(AF_INET,SOCK_STREAM)
client_sock.connect(addr)

while True:
	data = raw_input('>>')
	if data == 'exit':
		break
	elif data == None:
		print '发送空数据'
	client_sock.send(data)
	data = client_sock.recv(BUF_SIZE)
	if not data:
		break
	print(data)

client_sock.close()
